package com.muki.wareHouse;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DefaultSpiderParser implements SpiderParser {

	private String regx;
	
	public DefaultSpiderParser(String regx) {
		this.regx = regx;
	}
	
	@Override
	public void parse(String context,String topic) {
		Pattern pattern = Pattern.compile(regx,
				Pattern.CASE_INSENSITIVE);
		Matcher matcher = pattern.matcher(context);
		while(matcher.find()) {
			String link = matcher.group();
			handle(link);
		}
	}

	@Override
	public void handle(String url) {
		
	}

}
